package org.qq.bean;


/**
 * 
 * project_name:QQ
 * package_name:org.qq.bean
 * file_name:User.java
 * @author Link
 * create_date:2015年8月28日 上午10:29:47
 * modified_date:
 * description: 用户信息类
 *
 */
public class User {

	private String userName;		//用户帐号
	private String nickName;		//昵称
	private String password;		//密码
	private String sex;				//性别
	private String creatdate;		//创建日期
	private String ipAddress;		//ip地址
	
	
	
	public User() {	//无參构造方法
		super();
	}



	public User(String userName, String nickName, String password, String sex,String creatdate,String ipAddress) {	//全參构造方法
		super();
		this.userName = userName;
		this.nickName = nickName;
		this.password = password;
		this.sex = sex;
		this.creatdate = creatdate;
		this.ipAddress =ipAddress;
	}

	/**
	 * 
	 * description: 属性的setter和getter方法
	 * 2015年8月28日 上午10:28:42
	 * @author Link
	 * String
	 *
	 */
	
	public String getUserName() {
		return userName;
	}
	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getCreatdate() {
		return creatdate;
	}
	public void setCreatdate(String creatdate) {
		this.creatdate = creatdate;
	}


	/**
	 * 重写equals方法(根据用户帐号来判断用户是否存在)
	 */
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		if(obj instanceof User){
			User user = (User)obj;
			if(user.getUserName() == this.userName){
				return true;
			}
		}
		return false;
	}



	/**
	 * 重写tostring()方法
	 */
	@Override
	public String toString() {
		return "帐号:" + userName + "----密码:" + password+"----IP地址:"+ipAddress
				+ "----昵称:" + nickName + "----性别:" + sex+"----注册日期:" + creatdate+"-----regist";
	}
	
	
	
}
